from  celery import Celery
import os


if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'shopping_mall.settings.dev'

# 1: 创建一个Celery对象
celery_app = Celery("meiduo")

# 2: 加载配置文件
celery_app.config_from_object("celery_tasks.config")

# 3:设置自动捕获tasks
celery_app.autodiscover_tasks(["celery_tasks.sms", "celery_tasks.email"])




